package com.boang.service;

import com.boang.entity.Cla;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import java.sql.SQLException;
import java.util.List;

import static org.junit.jupiter.api.Assertions.*;

class ClaServiceTest {

    private ClaService claService;

    @BeforeEach
    public void setUp() {
        claService = new ClaService();
    }

    @Test
    void addCla() throws SQLException {
        Cla cla = new Cla(1, "200期");
        int i = claService.addCla(cla);
        System.out.println(i);
    }

    @Test
    void removeCla() throws SQLException {
        claService.removeCla(27);
    }

    @Test
    void updateCla() throws SQLException {
        Cla cla = new Cla(26, "200期");
        claService.updateCla(cla);
    }

    @Test
    void listCla() throws SQLException {
        List<Cla> list = claService.listCla();
        list.forEach(System.out::println);
    }
}